import React, { Component } from 'react'
import {NavLink} from 'react-router-dom'

interface Iprops{
    history:any
}

export default class My extends Component<Iprops>{
    render() {
        return (
            <div>
                <div className="my-top">
                    {localStorage.getItem('username') ? localStorage.getItem('username') : <div>
                        <NavLink to="/login">登录</NavLink>/<NavLink to="/registry">注册</NavLink>
                   </div>}
                   <div className="con">
                        <button onClick={() => {this.props.history.push('/votelist/join')}}>我参与的投票</button>
                        <button onClick={() => {this.props.history.push('/votelist/create')}}>我创建的投票</button>
                        <button onClick={() => {this.props.history.push('/create')}}>创建投票</button>
                   </div>
                </div>
            </div>
        )
    }
}
